<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Comment</title>
    <script src="../xcommentform.js"></script>
    <script src="../xcommentlist.js"></script>
    <script src="../xcomment-mobile.js"></script>
    <script src="../../simpleTemplate/index.js"></script>
    
    <script src="./comment.js"></script>
    <link rel="stylesheet" href="../xcomment.css">
    <link rel="stylesheet" href="../xcomment-mobile.css">
</head>
<body>
<button type="button" onclick="c.commentForm.destroy()">销毁 pc 版 form</button>
<button type="button" onclick="c2.destroy()">销毁 m 版 form</button>

<div id="demo2" style="width: 400px; border: 1px solid red;"></div>
<div id="demo" style="width: 800px; margin: 0 auto"></div>

<script>
var c = new Comment({
    isLogin: true,
    onLogin: function() {
        console.log('login')
    },
    formAvatar: 'http://i0.hdslb.com/bfs/face/0609670dfc759b43bd0a915e72889d901e7637a6.jpg@52w_52h.webp'
});
c.render('demo');


var c2 = new XCommentMobile({
    onSubmit: function(v) {
        console.log(v);
        
        c2.clear();
    }
});
document.getElementById('demo2').appendChild(c2.getDom())
</script>
</body>
</html>
